package com.brother.util;

public class LatLngConverter {

	
	
	
	
	/**将分制转换成十进制，前面两位是度数，后面是分
	 * @param lat1
	 * @return
	 */
	public static float toAl(float lat1) {
		float a = (int)(lat1 / 100f);
		float b = (lat1 - a * 100f) / 60f; 
		return a+b;
	}

	/*
	 * lat1纬度整数，lat2纬度分数
	 * */
	private static float[] addLatSix(float lat1, float lat2, float amount) {
		float[] r = new float[2];
			lat2 = lat2 + amount;
			lat1 = (int)(lat2 / 60f) + lat1;
			
			lat2 = (lat2 - (int)(lat2 / 60f)*60f);
			r[0] = lat1;
			r[1] = lat2;
		return r;
	}	
	
	
	//  Convert a float number to fen number. e.g.  1.50000 to 30.0000 just skip the integer.
	public static float toFen(float f){
		f = f - (int)f;
		f = f * 60;
		
		return f;
		
	}
	
}
